import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

// 播放次数过滤器
Vue.filter('count', function (value) {
  if (!value) return ''
  return parseInt(value / 10000) > 10000
        ? (value / 100000000).toFixed(1) + "亿"
        : parseInt(value / 10000) > 1
        ? (value / 10000).toFixed(1) + "万"
        : value;
})

// 补全图片地址
Vue.filter('picUrl', function (value) {
  if (!value) return ''
  return `${value}?imageView=1&type=webp&thumbnail=247x0`
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
